from django.db import models
from subjects_app.models import Subject

class Chapter(models.Model):
    name = models.CharField(max_length=100, verbose_name="章节名称")
    description = models.TextField(blank=True, null=True, verbose_name="章节描述")
    icon = models.TextField(blank=True, null=True, max_length=255, verbose_name="章节图标")
    brief = models.TextField(blank=True, null=True, max_length=255, verbose_name="章节简介")
    level = models.IntegerField(blank=True, null=True, verbose_name="章节级别")
    subject = models.ForeignKey(Subject, on_delete=models.CASCADE, verbose_name="所属学科")

    class Meta:
        db_table = 't_chapters'